package com.hyou.sc.eureka.client.auth.dto.form;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;

import com.hyou.springboot.annotation.validator.EnumRange;
import com.hyou.springboot.base.BaseForm;
import com.hyou.springboot.validator.group.AddGroup;
import com.hyou.springboot.validator.group.UpdateGroup;

public class UserForm extends BaseForm {
    
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -3625300618113063559L;
    
    /**
     * ID
     */
    @NotBlank(groups = UpdateGroup.class, message = "用户ID不能为空")
    @Digits(groups = UpdateGroup.class, integer = 20, fraction = 0, message = "用户ID数据格式有误")
    private String id;
    
    /**
     * 账号
     */
    @NotBlank(groups = AddGroup.class, message = "账号不能为空")
    private String account;
    
    /**
     * 密码,MD5(account + password)
     */
    @NotBlank(groups = AddGroup.class, message = "密码不能为空")
    private String passwd;
    
    /**
     * 用户名
     */
    @NotBlank(groups = AddGroup.class, message = "用户名不能为空")
    private String name;
    
    /**
     * 状态。0-禁用;1-启用
     */
    @EnumRange(groups = UpdateGroup.class, range = {"0", "1"}, message = "用户状态取值范围有误")
    private String status;
    
    /**
     * @return id ID
     */
    public String getId() {
        return this.id;
    }
    
    /**
     * @param id ID
     */
    public void setId(String id) {
        this.id = id;
    }
    
    /**
     * @return account 账号
     */
    public String getAccount() {
        return this.account;
    }
    
    /**
     * @param account 账号
     */
    public void setAccount(String account) {
        this.account = account;
    }
    
    /**
     * @return passwd 密码,MD5(account + password)
     */
    public String getPasswd() {
        return this.passwd;
    }
    
    /**
     * @param passwd 密码,MD5(account + password)
     */
    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }
    
    /**
     * @return name 用户名
     */
    public String getName() {
        return this.name;
    }
    
    /**
     * @param name 用户名
     */
    public void setName(String name) {
        this.name = name;
    }
    
    /**
     * @return status 状态。0-禁用;1-启用
     */
    public String getStatus() {
        return this.status;
    }
    
    /**
     * @param status 状态。0-禁用;1-启用
     */
    public void setStatus(String status) {
        this.status = status;
    }
    
}
